package net.wsfcp.android.http;


import net.wsfcp.android.BuildConfig;
import net.wsfcp.android.base.BaseHttpResult;
import net.wsfcp.android.bean.resultbean.AddressBean;
import net.wsfcp.android.bean.resultbean.BillBean;
import net.wsfcp.android.bean.resultbean.CityBean;
import net.wsfcp.android.bean.resultbean.DrawerBean;
import net.wsfcp.android.bean.resultbean.OrderBean;
import net.wsfcp.android.bean.resultbean.OrderQuantityBean;
import net.wsfcp.android.bean.resultbean.PublicKeyBean;
import net.wsfcp.android.bean.resultbean.TabBean;
import net.wsfcp.android.bean.resultbean.UserAssetsBean;
import net.wsfcp.android.bean.resultbean.UserBean;

import java.util.ArrayList;

import io.reactivex.Flowable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Url;



/**
 * Created by Shaoboyang on 2018/12/14.
 * 网络请求的接口都在这里
 */

public interface HttpService {


    //获取公钥
    @POST("commons/get_public_key.uss")
    Flowable<BaseHttpResult<PublicKeyBean>> getPublicKey();

    //获取图片验证码
    @POST("common/get_image_verify_code.uss")
    Call<ResponseBody> getCodeImage();//图形验证码

    //会员登录接口
    @POST
    Flowable<BaseHttpResult<UserBean>> login(@Url String url,@Body RequestBody body);

    //会员注册接口
    @POST
    Flowable<BaseHttpResult<UserBean>> register(@Url String url,@Body RequestBody body);

    //会员找回密码接口
    @POST("member/find_pwd_by_email.uss")
    Call<BaseHttpResult> findPassword(@Body RequestBody body);

    //会员修改密码接口
    @POST
    Call<BaseHttpResult> changePassword(@Url String url, @Body RequestBody body);

    //会员获取订单列表-1:已取消 0:未处理 1:配送中 2:已完成 3:已评价
    @POST
    Flowable<BaseHttpResult<OrderBean>> getOrderList(@Url String url, @Body RequestBody body);

    //获取订单数量接口
    @POST
    Flowable<BaseHttpResult<OrderQuantityBean>> getOrderQuantity(@Url String url);

    //订单详情
    @POST
    Flowable<BaseHttpResult<OrderBean.OrderList>> getOrderDetail(@Url String url, @Body RequestBody body);


    //取消订单
    @POST
    Call<BaseHttpResult> cancelOrder(@Url String url, @Body RequestBody body);

    //确认收货
    @POST
    Call<BaseHttpResult> confirmReceipt(@Url String url, @Body RequestBody body);


    //    获取侧滑栏目页面数据
    @POST("channel/get_channel_page_data.uss")
    Flowable<BaseHttpResult<DrawerBean>> getChannelPageData(@Body RequestBody body);

    //    获取底部导航栏数据
    @POST("channel/get_navigation_bar_menus.uss")
    Flowable<BaseHttpResult<ArrayList<TabBean>>> getTabBar(@Body RequestBody body);

    //    获取省市国家列表
    @POST("basedata/get_base_address_list.uss")
    Flowable<BaseHttpResult<ArrayList<CityBean>>> getCity(@Body RequestBody body);


    //收货地址一览
    @POST
    Flowable<BaseHttpResult<ArrayList<AddressBean>>> getAddressList(@Url String url);

    //保存收货地址
    @POST
    Call<BaseHttpResult> saveServiceAddress(@Url String url, @Body RequestBody body);

    //删除收货地址
    @POST
    Call<BaseHttpResult> deleteAddress(@Url String url, @Body RequestBody body);

    //设置默认收货地址
    @POST
    Call<BaseHttpResult> setDefaultAddress(@Url String url, @Body RequestBody body);

    //获取账单一览
    @POST
    Flowable<BaseHttpResult<BillBean>> getBillList(@Url String url, @Body RequestBody body);

    //获取用户总资产
    @POST
    Flowable<BaseHttpResult<UserAssetsBean>> getTotalAssets(@Url String url);

    //保存用户信息
    @POST
    Call<BaseHttpResult> updateUser(@Url String url, @Body RequestBody body);
}
